package com.itlong.cloud.sdk.dao;

import com.itlong.cloud.POJO.PO.DeviceElevatorFloorConfigPO;
import com.itlong.cloud.POJO.VO.sdk.CloudElevatorSDKGetByDeviceUniqueVO;
import com.itlong.cloud.POJO.VO.sdk.RobotNoninductiveDeviceUniqueVO;
import com.itlong.cloud.POJO.VO.sdk.RobotNoninductiveHistoryRecordVO;
import com.itlong.cloud.POJO.VO.sdk.SDKDeviceCloudControllerInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      云电梯SDK设备服务持久层接口
 * <desc/>
 *
 * @createDate 2018/12/27
 */
@Mapper
@Repository
public interface ICloudElevatorSDKServerCloudDao {

    /**
     * <desc>
     *      查询项目下电梯设备唯一码列表
     * </desc>
     *
     * @param params 查询条件参数集
     * @return 设备唯一码列表
     * @author wangzhi
     * @createDate 2018/12/27
     */
    List<String> getElevatorPage(Map<String, Object> params);

    /**
     * <desc>
     *     查询总设备数
     * </desc>
     *
     * @param params 查询条件参数集
     * @return 总设备数
     * @author wangzhi
     * @createDate 2018/12/27
     */
    Integer getElevatorTotalNumber(Map<String, Object> params);

    /**
     * <desc>
     *      根据设备唯一码查询电梯信息
     * </desc>
     *
     * @return 根据设备唯一码查询电梯信息VO
     * @author wangzhi
     * @createDate 2018/12/28
     */
    List<CloudElevatorSDKGetByDeviceUniqueVO> getElevatorInfo(List<String> deviceUniques);

    /**
     * <desc>
     *      根据设备唯一码查询电梯信息
     * </desc>
     *
     * @return 根据设备唯一码查询电梯信息VO
     * @author wangzhi
     * @createDate 2018/12/28
     */
    List<RobotNoninductiveDeviceUniqueVO> getElevatorInfoForRobot(List<String> deviceUniques);

    /**
     * <desc>
     *      根据楼层名称获取真实楼层
     * </desc>
     *
     * @param goFloor
     * @param fromFloor
     * @return
     * @author Jiaqi.X
     * @createDate 2018/01/03
     */
    Map<String, Object> getFloorNumByLogicFloor(@Param("goFloor") String goFloor,
                                                @Param("fromFloor") String fromFloor,
                                                @Param("deviceUnique") String deviceUnique);

    /**
     * <desc>
     *      获取上报状态详情
     * </desc>
     *
     * @param appId
     * @param appSecret
     * @param projectId
     * @return
     * @author Jiaqi.X
     * @createDate 2019/01/03
     */
    Map<String,Object> getReportInfo(@Param("appId") String appId,
                                     @Param("appSecret") String appSecret,
                                    @Param("projectId") String projectId);

    /**
     * <desc>
     *      获取设备序列号
     * </desc>
     *
     * @param deviceIds
     * @param projectId
     * @return
     * @author Jiaqi.X
     */
    String getElevatorDeviceUniquesByDeviceIds(@Param("deviceIds") String[] deviceIds,@Param("projectId") String projectId);

    /**
     * <desc>
     *      根据楼层名称获取实际楼层和权限标识
     * </desc>
     *
     * @param floors
     * @param deviceUnique
     * @return
     * @author Jiaqi.X
     * @createDate 2019/08/15
     */
    Map<String,Object> getFloorNumAndNaturalFloorByLogicFloor(@Param("floors") String[] floors,@Param("deviceUnique") String deviceUnique);

    /**
     * <desc>
     *      根据群控器机号查询所绑定的电梯
     * </desc>
     *
     * @param controllerDeviceUnique
     * @return
     * @author Jiaqi.X
     * @createDate 2019/07/24
     */
    String getDeviceUniqueByControllerDeviceUnique(@Param("controllerDeviceUnique") String controllerDeviceUnique);

    /**
     * <desc>
     *      查询呼梯记录
     * </desc>
     *
     * @param params
     * @return
     * @author Jiaqi.X
     * @createDate 2019/07/24
     */
    List<RobotNoninductiveHistoryRecordVO> getHistoryRecords(Map<String,Object> params);

    /**
     * <desc>
     *      查询呼梯记录
     * </desc>
     *
     * @param params
     * @return
     * @author Jiaqi.X
     * @createDate 2019/07/24
     */
    Integer getHistoryRecordsCount(Map<String,Object> params);

    /**
     * <desc>
     *      更新呼梯记录
     * </desc>
     *
     * @param recordId
     * @return
     * @author Jiaqi.X
     * @createDate 2019/08/01
     */
    Integer updateHistoryRecord(@Param("recordId") String recordId,@Param("deviceUnique") String deviceUnique);

    /**
     * <desc>
     *     获取楼层信息
     * </desc>
     *
     * @param params
     * @return
     * @author caoshuai
     * @createDate 2020/08/05
     */
    List<DeviceElevatorFloorConfigPO> getFloorInfoByMap(Map<String, Object> params);

    /**
     * <desc>
     * 获取云控制器信息
     * </desc>
     *
     * @param deviceUnique
     * @return
     * @author caoshuai
     * @createDate 2020/08/05
     */
    SDKDeviceCloudControllerInfoVO getDeviceCloudControllerInfo(String deviceUnique);

    /**
     * <desc>
     *  查询华为云下群控器所绑定的设备
     * </desc>
     *
     * @param controllerDeviceUnique
     * @return
     * @author caoshuai
     * @createDate 2020/08/10
     */
    String getDeviceUniqueBy(String controllerDeviceUnique);
}
